const path = require('path');
module.exports = {
  transpileDependencies: [
    'vuetify'
  ],
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [
        // 存放less变量文件的路径
        path.resolve(__dirname, "./src/assets/less/parameter.less")
      ]
    }
  },
  chainWebpack: config => {
    config
      .plugin('html')
      .tap(args => {
        args[0].title= '横店影视文化产业大脑'
        return args
      })
    config.module.rule('images')
      .test(/\.(png|jpeg|jpg|pdf)$/)
      .use('url-loader')
      .loader('url-loader').options({
      limit: 1024*10,// 小于10k的图片采用baseurl，大于和等于8k的就正常打包成图片
      name:'static/img/[name].[ext]'//图片大于等于10k时，设置打包后图片的存放位置 name是文件名   ext是文件后缀
    })
    config.module.rule('fonts')
      .test(/\.(woff2?|eot|ttf|otf)(\?.*)?$/)
      .use('url-loader')
      .loader('url-loader').options({
      limit: 1024*10,// 小于10k的图片采用baseurl，大于和等于8k的就正常打包成图片
      name:'static/fonts/[name].[hash:7].[ext]'
    })
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            'primary-color': '#ec6800'
          },
          javascriptEnabled: true,
        },
      },
    },
  },
  devServer: {
    hot: true,//自动保存
    open: true,//自动启动
    port: 9022,//默认端口号
    host: "0.0.0.0"
  },
  publicPath: "./",
  outputDir: "industrial_portal",
  assetsDir: "static",
  productionSourceMap: false
}
